#include "dialogvideotalk.h"
#include "ui_dialogvideotalk.h"

DialogVideoTalk::DialogVideoTalk(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogVideoTalk)
{
    ui->setupUi(this);

#if INDOOREMBED
    setWindowFlags(Qt::FramelessWindowHint);//隐藏窗口标题栏
#endif

    //取消按键虚线框
    ui->pbn_home->setFocusPolicy(Qt::NoFocus);
    ui->pbn_back->setFocusPolicy(Qt::NoFocus);
    ui->pbn_Answer->setFocusPolicy(Qt::NoFocus);
    ui->pbn_Fullscreen->setFocusPolicy(Qt::NoFocus);
    ui->pbn_Hungup->setFocusPolicy(Qt::NoFocus);
    ui->pbn_Openlock->setFocusPolicy(Qt::NoFocus);

    ui->pbn_home->setText("");
    ui->pbn_back->setText("");
    ui->pbn_Answer->setText("");
    ui->pbn_Fullscreen->setText("");
    ui->pbn_Hungup->setText("");
    ui->pbn_Openlock->setText("");

    connect(ui->pbn_back, SIGNAL(clicked()), this, SLOT(close()));

    avtalk->StartMonitor();
}

DialogVideoTalk::~DialogVideoTalk()
{
    delete ui;
}

void DialogVideoTalk::paintEvent(QPaintEvent *event)
{
    printf("DialogDailPad paintEvent \n");
#if 0
    QPainter painter(this);
    painter.drawPixmap(0, 0, 800, 480, QPixmap("./images/videotalk.jpg"));
#endif
}

void DialogVideoTalk::on_pbn_Fullscreen_clicked()
{
    avtalk->ZoomOut();
}

void DialogVideoTalk::on_pbn_Hungup_clicked()
{
    avtalk->EndMonitor();
}

void DialogVideoTalk::on_pbn_Openlock_clicked()
{
    avtalk->OpenLock();
}
